<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>JavaScript</title>
</head>
<body>


</body>
<script type="text/javascript">
  /*  var a = "双体系";
   // alert(a);//输出
    console.log(a);//控制台输出

    let b = "峰林二部";
    console.log(b);

    const c = "牛";
    console.log(c);

    d = "帅!!!";
    console.log(d);

   /!* var e;
    console.log(e);
    console.log(typeof f);*!/

   var g = null;
   console.log(g)
*/
 /*
//函数的声明与调用
  function add(a,b) {
      return a + b;
  }
  var s = add(33,54);
  console.log(s);
  */

 var user1 = new Object();
 user1.name = "张三";
 user1.age = 33;

 console.log(user1);
 //alert(user1);不能转

    var user2 = {
        "name":"李四",
        "age":32
    };
    console.log(user2);

    //定义数组
    var a1 = new Array();
    a1[0] = "张三";
    a1[1] = "李四";

    a1.push("王五");//不用写索引，往里压
  a1.pop();//挤出元素
  a1.slice();//截取元素
  a1.splice();//删除元素
    console.log(a1);

    var a2 = ["赵六","赵四"];
    a2.push("麻子");

  for (var i = 0; i < a2.length ; i++) {
      console.log(a2[i]);
  }
  for (var index in a2){
      console.log(a2[index]);
  }


</script>
</html>